<?php if (!defined('SERVER_ROOT')) exit('No direct script access allowed');

class canbonghihuu_Controller extends Controller {
    function __construct(){
        parent::__construct('qlcb', 'canbonghihuu');
        $this->check_login();
        $this->view->template->menu_html =$this->CREATE_MENU();
        $this->view->template->nhacviec_html =$this->CREATE_NHAC_VIEC(); 
        $this->CHECK_QUYEN('qlcb', 'canbonghihuu');
    }
    function main(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $this->dsp_all_canbo();
    }

    function dsp_all_canbo(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $VIEW_DATA['arr_all_canbo'] = $this->model->SELECT_CAN_BO_NGHI_HUU();
        $this->view->render('dsp_all_canbo',$VIEW_DATA);
    }
    function dsp_nghihuu($MA_CAN_BO){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $MA_CAN_BO  = replace_bad_char($MA_CAN_BO);
        $TEN_CAN_BO = replace_bad_char($_REQUEST['tencanbo']);
        $VIEW_DATA['var_macanbo'] = $MA_CAN_BO;
        $VIEW_DATA['var_tencanbo'] = $TEN_CAN_BO;
        $this->view->render('dsp_nghihuu',$VIEW_DATA);
    }
    public function capnhat_nghihuu(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $this->model->capnhat_nghihuu();
    }
    public function dsp_single_canbo(){
        (Session::get(TIEP_DAU_NGU_SESSION.'QUAN_TRI') == 1) Or die($this->access_denied());
        $v_m                      = trim(get_request_var('m'));
        $VIEW_DATA['var_macanbo'] = $v_m;
        $VIEW_DATA['arr_single_canbo'] = $this->model->qry_single_canbo($v_m);
        $VIEW_DATA['arr_all_dantoc'] = $this->model->SELECT_DANTOC_nothing();
        $VIEW_DATA['arr_all_tongiao'] = $this->model->SELECT_TONGIAO_nothing();
        $VIEW_DATA['arr_all_quoctich'] = $this->model->SELECT_QUOCTICH_nothing();
        $VIEW_DATA['arr_all_hocham'] = $this->model->SELECT_HOCHAM_nothing();
        $VIEW_DATA['arr_all_hocvi'] = $this->model->SELECT_HOCVI_nothing();
        $VIEW_DATA['arr_all_loaicanbo'] = $this->model->SELECT_LOAICANBO_nothing();
        $this->view->render('dsp_single_canbo', $VIEW_DATA);
    }

}
